package com.jeesite.modules.dataScreen.web;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jeesite.modules.dataScreen.service.TrafficZfService;
import com.jeesite.modules.dataScreen.web.vo.Result;
import com.jeesite.modules.dataScreen.web.vo.trafficzf.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/trafficZf")
@Api(tags = "交通执法")
public class TrafficZfApi {

    @Resource
    private TrafficZfService trafficZfService;

    @GetMapping("/latest")
    @ApiOperation("获取最新一条交通执法数据")
    public Result<TrafficZfVo> latestOne() {
        return Result.OK(trafficZfService.getTrafficwf());
    }

    @GetMapping("/quality")
    @ApiOperation("质检列表数据")
    public Result<JSONObject> quality() {
        return Result.OK(trafficZfService.getQuality());
    }

    @GetMapping("/anjianPage")
    @ApiOperation("案件列表接口")
    @ApiImplicitParam(name = "type", value = "区分支队 1：高支;2:直属支队;3:轨道支队；4:港航支队；5:质监支队；6:区县支队")
    public Result<JSONObject> anjianMonth(@RequestParam Integer type) {
        return Result.OK(trafficZfService.anJianMonth(type));
    }

    @GetMapping("/xyczc")
    @ApiOperation("迅游出租车饼图")
    public Result<List<JSONObject>> xyczc() {
        return Result.OK(trafficZfService.jthytzzb("巡游出租车"));
    }

    @GetMapping("/wyczc")
    @ApiOperation("网约出租车柱状图")
    public Result<List<JSONObject>> wyczc() {
        return Result.OK(trafficZfService.jthytzzb("网约出租车"));
    }

    @GetMapping("/anjianNumber")
    @ApiOperation("案件数量")
    public Result<JSONObject> anjianNumber() {
        return Result.OK(trafficZfService.anjianNumber());
    }

    @GetMapping("/pointLines")
    @ApiOperation("重点超限数据")
    public Result<List<TrafficPointLine>> pointLines() {
        return Result.OK(trafficZfService.pointLines());
    }
    @GetMapping("/caseHandler")
    @ApiOperation("案件办理")
    public Result<CaseHandlerVo> caseHandler() {
        return Result.OK(trafficZfService.caseHandler());
    }
    @GetMapping("/checkWarning")
    @ApiOperation("检查预警-部分")
    public Result<CheckWarningVO> checkWarning() {
        return Result.OK(trafficZfService.checkWarning());
    }


}
